package com.liao.myblog.controller;

import com.liao.myblog.enums.ResultCode;
import com.liao.myblog.vo.ResultVO;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HttpErrorController implements ErrorController {

    @RequestMapping(path = "/error")
    public ResultVO<Object> urlErrorController() {
        return new ResultVO<>(ResultCode.UNEXIST_URL);
    }

    @Override
    public String getErrorPath() {
        System.out.println("HttpErrorController.getErrorPath");
        return null;
    }
}
